bitkeeper revision 1.1159.241.1 (4202bb72zRYg-QWeXrkKfXwmuL5I3A)
authoriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Fri, 4 Feb 2005 00:01:54 +0000 (00:01 +0000)
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Fri, 4 Feb 2005 00:01:54 +0000 (00:01 +0000)
Add checking ISA DMA flag in cpu_loop. Also need to do bios_init manually
for now. With this change, floppy is functional.

Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
Signed-off-by: ian.pratt@cl.cam.ac.uk
tools/ioemu/iodev/cpu.cc
tools/ioemu/iodev/dma.cc
tools/ioemu/iodev/dma.h

index 5d8c09a3423d40c9d3328eaaf41838ea5e3f5cdb..17a85539ce3c54335aa460394205139aea655e6c 100644 (file)
@@ -213,6 +213,10 @@ bx_cpu_c::cpu_loop(int max_instr_count)
 #endif
                        interrupt(vector);
                }
+               /* we check DMA after interrupt check*/
+               while(BX_HRQ){
+                       DEV_dma_raise_hlda();
+               }
 
                if (send_event) {
                        int ret;
index 9b99bad5f55ae41a22ecffadf318127f0ea450b9..afe0238a926f74bee8b8443b51326539f2a0be2f 100644 (file)
@@ -182,6 +182,14 @@ bx_dma_c::init(void)
     }
   BX_DMA_THIS s[1].chan[0].used = 1; // cascade channel in use
   BX_INFO(("channel 4 used by cascade"));
+  bios_init();
+}
+
+/* Remove it when guest fw ready*/
+  void
+bx_dma_c::bios_init(void){
+  BX_DMA_THIS s[1].mask[0] = 0; // unmask cascade channel  
+  BX_DMA_THIS s[1].chan[0].mode.mode_type = 3; // cascade mode for channel 4
 }
 
   void
@@ -189,6 +197,7 @@ bx_dma_c::reset(unsigned type)
 {
   reset_controller(0);
   reset_controller(1);
+  bios_init();
 }
 
   void
index 90ac9da707fb5febfcc6ea6fb92113ff963f4500..9f6c4eb60e630383c545e913b9be91bc402bd0f9 100644 (file)
@@ -46,6 +46,7 @@ public:
   ~bx_dma_c(void);
 
   virtual void     init(void);
+  virtual void     bios_init(void);
   virtual void     reset(unsigned type);
   virtual void     raise_HLDA(void);
   virtual void     set_DRQ(unsigned channel, bx_bool val);